//
//  AlertTool.h
//  liveFrame
//
//  Created by apple on 16/8/4.
//  Copyright © 2016年 apple. All rights reserved.
//

#import <UIKit/UIKit.h>

/// 回调block
typedef void (^JLXXAlertToolBlock) (NSInteger index ,UITextField * __nullable textField);
typedef void (^JLXXAlertToolBlockWithoutTextFiled) (NSInteger index);

@interface AlertTool : NSObject

+(void)showInView:(UIView *_Nonnull)view;

+(void)showInView:(UIView *_Nonnull)view withTitle:(NSString *_Nullable)title;

+(void)showInView:(UIView *_Nonnull)view onlyWithTitle:(NSString *_Nonnull)title ;

+(void)showInView:(UIView *_Nonnull)view onlyWithTitle:(NSString *_Nullable)title autoDisapper:(BOOL)isAuto;

+(void)showErrorInView:(UIView *_Nonnull)view withTitle:(NSString *_Nonnull)title;

+(void)showWithCustomModeInView:(UIView * _Nonnull)view;

+(void)showWithCustomModeInView:(UIView *_Nonnull)view withTitle:(NSString *__nullable)title;

+(void)hidden;

+(void)hiddenAfterDelyte:(NSTimeInterval)delyte;

/**
 普通alert定义alertController,取消按钮不会回调事件
 
 @param title 标题
 @param message 详细信息
 @param style UIAlertControllerStyle
 @param block 用于执行方法的回调block
 @param cancelTitle 取消按钮
 @param destructiveTitle alertController的特殊按钮类型
 @param presentingController 当前视图，alertController模态弹出的指针
 @param otherButtonTitles 其他按钮 变参量 但是按钮类型的相对位置是固定的
 
 NS_REQUIRES_NIL_TERMINATION 是一个宏，用于编译时非nil结尾的检查 自动添加结尾的nil
 ***注意1***
 block方法序列号和按钮名称相同，按钮类型排列顺序固定
 如果取消为nil，则index0为特殊，以此往后类推，以第一个有效按钮为0开始累加
 取消有的话默认为0
 
 */

/// alertStyle 不带textFiled
+ (void)alertStyleWithTitle:(NSString *__nullable)title message:(NSString *__nullable)message needCancelCallBack:(BOOL)needCancelCallBack cancelButtonTitle:(NSString *__nullable)cancelTitle destructiveButtonTitle:(NSString *__nullable)destructiveTitle presentingController:(UIViewController *__nullable)presentingController otherButtonTitles:(NSArray *__nullable)otherButtonTitles callbackBlock:(__nullable JLXXAlertToolBlockWithoutTextFiled)block;

/// alertStyle 带textFiled 并且可以填写Placeholder,并且可以填写keyboardType 的alertController
+ (void)alertStyleWithTitle:(NSString *__nullable)title message:(NSString *__nullable)message needCancelCallBack:(BOOL)needCancelCallBack cancelButtonTitle:(NSString *__nullable)cancelTitle destructiveButtonTitle:(NSString *__nullable)destructiveTitle textFiledPlaceholder:(NSString *__nullable)placeholder textFieldKeyboardType:(UIKeyboardType)keyboardType presentingController:(UIViewController *__nullable)presentingController otherButtonTitles:(NSArray *__nullable)otherButtonTitles callbackBlock:(__nullable JLXXAlertToolBlock)block ;

/// sheetStyle
+ (void)sheetStyleWithTitle:(NSString *__nullable)title message:(NSString *__nullable)message needCancelCallBack:(BOOL)needCancelCallBack cancelButtonTitle:(NSString *__nullable)cancelTitle destructiveButtonTitle:(NSString *__nullable)destructiveTitle presentingController:(UIViewController *__nullable)presentingController otherButtonTitles:(NSArray *__nullable)otherButtonTitles callbackBlock:(__nullable JLXXAlertToolBlockWithoutTextFiled)block;


@end
